// 引用 组件调用js
Vue.use(httpVueLoader);


var localStorage = window.localStorage,
    sessionStorage = window.sessionStorage;

var token = sessionStorage.getItem("token");
var userName = sessionStorage.getItem("userName");
var email = sessionStorage.getItem("email");
var permission = sessionStorage.getItem("permission");

// 获取路径参数
function GetQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]);
    return null;
}

// 新建一个vue loding 对象示例
var vue_loading = new Vue({
  el: '#load',
  data: {
    showLoading: false
  },
  components: {
    'loading': {
      template: "<div class='loading'> <img src='./images/loading.gif'></div>",
    }
  }
});


// vue.js公共mounted
var mixin_common = {
    data: {
        userName:userName,
        email:email,
        permission:permission
    },
    created: function() {},
    mounted: function() {
    },
    filters:{
        date_format:function (val) {
            if (val=="0001-01-01") {
                return "无"
            } else {
                return val
            }
        }        
    },
    methods: {
        
    }

};

// 公共footer
Vue.component('common_footer', {
    template: "<footer class='footer'>\
            <div class='product-name'>\
              <img src='./images/dnb_full_logo.png' >\
              <span class='prod-name'></span>\
            </div>\
            <ul class='company-info'>\
              <li class='copyright'>&copy; Dun &amp; Bradstreet, Inc. 2018. All Rights Reserved.</li>\
              <li><a href='http://www.dnb.com/privacy-policy.html' target='_blank'>Privacy Policy</a></li>\
              <li><a href='http://www.dnb.com/terms-of-use.html' target='_blank'>Terms </a></li>\
            </ul>\
        </footer>",
    
});
